import {http} from "@/utils";

// 获取频道列表
function getChannelAPI() {
    return http({
        url:'/channels',
        method:'GET'
    })
}

// 提交文章表单
function createArticleAPI(data){
    return http({
        url:`/mp/articles?draft=false`,
        method:"POST",
        data:data


    })
}

// 获取文章内标
function getArticleListAPI(params) {
    return http({
        url:'/mp/articles',
        method:'GET',
        params

    })
}

// 删除文章
 function delArticleAPI(id) {
    return http({
        url:`/mp/articles/${id}`,
        method:'delete',
    })
}

// 获取文章详情
function getArticleById(id) {
    return http({
        url:`/mp/articles/${id}`
    })
}


export {
    getChannelAPI,createArticleAPI,getArticleListAPI,delArticleAPI,getArticleById
}